package com.flca.servlet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public abstract class StartupServletBase extends HttpServlet {

	public static final String GUICE_MODULE = "guice.module";

	protected static Logger logger;

	private static final long serialVersionUID = -3828778096900211045L;

	public abstract void init() throws ServletException;

	protected void logWarn(String aMsg) {
		getLogger().warn(aMsg);
		// System.out.println(aMsg);
	}

	protected void logInfo(String aMsg) {
		getLogger().info(aMsg);
		System.out.println(aMsg);
	}

	protected void logError(String aMsg, Exception ex) {
		getLogger().error(aMsg, ex);
		System.out.println(aMsg);
	}

	private Logger getLogger() {
		if (logger == null) {
			logger = LoggerFactory.getLogger(StartupServletBase.class);
		}
		return logger;
	}
}
